<c:if test="#{tagServiceEnabled}"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:nxp="http://nuxeo.org/nxweb/pdf"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:rich="http://richfaces.org/rich">

  <c:if test="#{nxl:isLikePlainMode(widget.mode)}">
    <nxu:inputList id="#{widget.id}_list" value="#{field}" model="model">
      <h:outputText value="#{model.rowData}" />
      <h:outputText rendered="#{model.rowIndex != model.rowCount -1}"
          value=", " />
    </nxu:inputList>
  </c:if>

  <c:if test="#{widget.mode == 'pdf'}">
    <nxp:html>
      <nxu:inputList
          value="#{field}" model="model" rendered="#{not empty field}">
        <h:outputText value="#{model.rowData}" />
        <h:outputText rendered="#{model.rowIndex != model.rowCount -1}"
            value=", " />
      </nxu:inputList>
    </nxp:html>
  </c:if>

  <c:if test="#{nxl:isLikeViewMode(widget.mode)}">
    <nxu:inputList id="#{widget.id}_list" value="#{field}" model="model">
      <h:panelGroup id="#{widget.id}_listItem">
          <span class="tag tagLink">
            <h:commandLink value="#{model.rowData}"
                action="#{tagActions.listDocumentsForTag(model.rowData)}" />
          </span>
      </h:panelGroup>
    </nxu:inputList>
  </c:if>

  <c:if test="#{widget.mode == 'edit'}">
    <a4j:outputPanel id="#{widget.id}_panel" layout="block">
      <span id="#{widget.id}_suggestDiv">
          <ui:include src="/incl/select2_js.xhtml" />
          <a4j:region>
            <h:inputHidden id="#{widget.id}_select2" immediate="true"
              ajaxSingle="true" value="#{field}">
              <f:converter converterId="select2Converter" />
            </h:inputHidden>
            <h:inputHidden readonly="true" id="#{widget.id}_select2_init"
              value="#{tagSelect2Support.resolveTags(field)}" />
          </a4j:region>
          <h:inputHidden readonly="true" id="#{widget.id}_select2_params"
            value="#{tagSelect2Support.encodeParameters(widgetProperties)}" />
      </span>
    </a4j:outputPanel>
  </c:if>

</c:if>